#ifndef NODE_H_
#define NODE_H_
#include "../IRecordable.h"
#include "../Record.h"
#include "RecordNode.h"
#include <vector>
using namespace Entities;

namespace Tree {

class Node: public IRecordable {

private:

	int nodeNumber; //identifier
	unsigned int level;
	vector<RecordNode*>* recordNodes;

protected:

	Node();

public:

	bool hasOverflow(unsigned int nodeMaxSize);
	bool hasUnderflow();
	virtual void addInNode(RecordNode* recordNodeToAdd) = 0;
	virtual void removeInNode(string keyToDelete) = 0;

	//getters and setters
	unsigned int getLevel();
	vector<RecordNode*>* getRecordNodes();
	void setLevel(unsigned int level);

	//IRecordable methods
	virtual void fillEntity(char *buffer, unsigned int bufferSize) = 0;
	virtual char* buildBuffer() = 0;
	virtual unsigned int getBufferSize() = 0;
	virtual unsigned int getEntityID();
	virtual void setEntityID(unsigned int entityID);

	virtual ~Node();
};

}

#endif /* NODE_H_ */
